package com.example.crossdomain.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @Description :
 * @Author : Bruce Lee
 * @CreateTime : 2024/6/25
 */

@RestController
@CrossOrigin
public class IndexController {

    @RequestMapping("/test")
    public HashMap<String, Object> test() {
        return new HashMap<String, Object>() {{
            put("state", 200);
            put("data", "success");
            put("msg", "跨域测试");
        }};
    }

}
